import re
from BeautifulSoup import BeautifulSoup

import re

p = re.compile(r'[,?!.`"]')
print p.sub( '', 'blue, soc!ks an?d re"d sho.es')

p = re.compile(r'\[\d+\]')
s = 'hi [5] your [asd asd] ,face.is[as] on[42]fire'
print p.sub(' ', s) # hi_your_face_is_on_fire

#html = "asdfasdf <!-- sdf -->"
html = '<!--[if lt IE 7]><script type="text/javascript">h4x0r();</script><![endif]--> sdsdf'
p = re.compile( '<!--(.|\n)*-->')
clean_html = p.sub("#",html)
#clean_html = re.sub(r'<!--[.\n]*?-->','',html)
print html
print clean_html

p = re.compile( '<!-- (.|\n)* -->')
print p.sub( 'colour', '<!-- fa\nsd --> socks and \nred shoes')

print "".join("asd")
list = ["The Queen of Rock &amp; Roll", ""]
print map(lambda line: unicode(BeautifulSoup(line,convertEntities=BeautifulSoup.HTML_ENTITIES)), list)
#decodedString=unicode(BeautifulSoup(line,convertEntities=BeautifulSoup.HTML_ENTITIES))
